﻿
Partial Class DetialArcticles
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
        If Request.QueryString("id") IsNot Nothing Then

            divListArticle.InnerHtml = ""
            Dim dictObjectKhachSan As Dictionary(Of String, Object) = TinhThanhServer.GetTinDuLichTheoID(Request.QueryString("id"))
            Dim listTinTuc As List(Of Dictionary(Of String, Object)) = TinhThanhServer.GetListTinDuLichTheoPCID(Util.GetDictionaryValueByKey(dictObjectKhachSan, "PCID"), Util.GetDictionaryValueByKey(dictObjectKhachSan, "PCreateDay"))
            Dim strHTML As String = " <ul data-role='listview'>"
            Dim strHTMLContent As String = "<div class='divTitle'  >"
            strHTMLContent &= " <h2 class='header'>"
            strHTMLContent &= "<a href='javascript:void(0);' title='" + Util.GetDictionaryValueByKey(dictObjectKhachSan, "PTitle") + "'"
            strHTMLContent &= "class='green' itemprop='url'><span itemprop='name'>"
            strHTMLContent &= Util.GetDictionaryValueByKey(dictObjectKhachSan, "PTitle") + "</span></a>"
            strHTMLContent &= "</h2>"
            strHTMLContent &= "</div>"
            strHTMLContent &= "<div class='divDate bottom-20' itemprop='datePublished' content='" + Util.GetDictionaryValueByKey(dictObjectKhachSan, "PCreateDay") + "'>"
            strHTMLContent &= Util.GetDictionaryValueByKey(dictObjectKhachSan, "PCreateDay") + "</div>"
            Dim strContent As String = Util.GetDictionaryValueByKey(dictObjectKhachSan, "PContent")
            strContent = strContent.Replace("../..", "http://www.khachsan24gio.vn")
            strHTMLContent &= "<div class'clear'></div><div class='divBody bottom-30' itemprop='articleBody'>" + strContent + "</div>"
            divContentDuLich.InnerHtml = strHTMLContent
            For i As Integer = 0 To listTinTuc.Count - 1
                If Not Util.GetDictionaryValueByKey(listTinTuc(i), "PDesc").Equals("") Then
                    Dim url As String = Util.GetConfigKey("RootURl") + Util.GetDictionaryValueByKey(listTinTuc(i), "PLink").ToString()
                    strHTML &= " <li class='liArticleItem'><a href='" + url + "' "
                    strHTML &= " Title = '" + Util.GetDictionaryValueByKey(listTinTuc(i), "PTitle") + "'> <span"
                    strHTML &= " class='thumb'>"
                    strHTML &= " <img title='" + Util.GetDictionaryValueByKey(listTinTuc(i), "PTitle") + "'"
                    strHTML &= " src='" + Util.GetDictionaryValueByKey(listTinTuc(i), "PImg") + "' width='80px' height='80px' /></span> <span class='heading'>"
                    strHTML &= Util.GetDictionaryValueByKey(listTinTuc(i), "PTitle") + "</span> <span class='desc'>"
                    strHTML &= Util.GetDictionaryValueByKey(listTinTuc(i), "PDesc") + "...</span>"
                    strHTML &= " </a></li>"
                End If
            Next
            strHTML = strHTML + " </ul>"
            divListArticle.InnerHtml = strHTML
        Else
            Response.Redirect("~/index.aspx")
        End If
    End Sub
End Class